package com.tg.data.http.entity;

import android.os.Parcel;
import android.os.Parcelable;

public class ClockTimeBean implements Parcelable {
    public byte hour = 0;
    public byte minute = 0;
    public byte second = 0;
    public byte reserved = 0;
    public ClockTimeBean(){

    }

    public String getTimeStr(){
        String start, end;
        if (hour < 10){
            start = "0" + hour + ":";
        }else{
            start = hour + ":";
        }

        if (minute < 10){
            end = "0" + minute;
        }else{
            end = minute + "";
        }

        String text = start + end;
        return text;
    }

    protected ClockTimeBean(Parcel in) {
        hour = in.readByte();
        minute = in.readByte();
        second = in.readByte();
        reserved = in.readByte();
    }

    public static final Creator<ClockTimeBean> CREATOR = new Creator<ClockTimeBean>() {
        @Override
        public ClockTimeBean createFromParcel(Parcel in) {
            return new ClockTimeBean(in);
        }

        @Override
        public ClockTimeBean[] newArray(int size) {
            return new ClockTimeBean[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeByte(hour);
        dest.writeByte(minute);
        dest.writeByte(second);
        dest.writeByte(reserved);
    }
}
